class BookCell {
  String id;
  int sectionCount;
  int buyCount;
  String img;
  String title;
  String userName;
  String avatarLarge;
  int price;

  BookCell(
      {this.id,
        this.buyCount,
        this.img,
        this.price,
        this.title,
        this.sectionCount,
        this.userName,
        this.avatarLarge
      });

  factory BookCell.fromJson(Map<String, dynamic> json) {
    return BookCell(
        id: json['booklet_id'],
        buyCount: json['base_info']['buy_count'],
        img: json['base_info']['cover_img'],
        title:json['base_info']['title'],
        price: json['base_info']['price'],
        sectionCount: json['base_info']['section_count'],
        userName: json['user_info']['user_name'],
        avatarLarge: json['user_info']['avatar_large']
    );
  }
}